package com.gws.ievent.db.disign.observer.event.resume;

import com.gws.ievent.db.disign.observer.BaseObserverListener;
import com.gws.ievent.db.disign.observer.event.cancel.EventCancelledObserver;
import com.gws.ievent.db.model.EventModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * @author song
 * @date 2022/10/23 9:10
 */
@Service
public class EventResumedObserverListener implements BaseObserverListener<EventModel> {

    @Autowired
    private List<EventResumedObserver> eventResumedObserverList;

    @Override
    public void notice(EventModel model) {
        if (CollectionUtils.isEmpty(eventResumedObserverList)) {
           return;
        }

        for (EventResumedObserver observer : eventResumedObserverList) {
            observer.update(model);
        }
    }

}
